import { useRef } from 'react'

import { Form } from 'antd';
export default function useForm() {
  const store = useRef(new FormStore()).current
  console.log(store);
  return [store]
}

// Form 实例仓库，要实现两个功能点
// 1.存储状态
// 2.更新状态 -> 更新仓库值 + 通知组件更新
export class FormStore {
  private store: Record<string, any> = {}
  
  setData<T>(key:string,value:T){
    console.log(key,value);
    this.store[key]=value
  }


}
